package com.ftg.learn.framework.mybatis.javabase.mapper;

import com.ftg.learn.framework.mybatis.javabase.entity.UserEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户处理类
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/9/6 上午8:16
 */
public interface UserMapper {

    /**
     * 是为了判断或者验证username 和   password 在数据库里面是否存在
     */
    @Select("select * from user where username=#{username} and password=#{password}")
    UserEntity checkUsernamePassword(@Param("username") String username, @Param("password") String password);


//    @Select("<script>select * from goods " +
//            "<where>" +
//            "   <if test=\"name != null\">" +
//            "     name like concat(#{name},'%')"+
//            "</if>" +
//            "</where>" +
//            " limit #{start},#{limit}" +
//            "</script>")
//    List<GoodsDetailVo> goodsAll(@Param("name")String name,@Param("start") int start, @Param("limit") int limit);

}
